/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykht.proj.activity.vo.CardShopDto;
import com.ykht.proj.activity.vo.CnDiscountShopVoReq;
import com.ykht.proj.activity.vo.CnGroupShopVoReq;
import com.ykht.proj.common.core.util.R;
import com.ykht.proj.coupon.entity.CnShop;
import com.ykht.proj.coupon.vo.*;

import java.util.List;
import java.util.Map;

/**
 * 店铺表
 *
 * @author proj code generator
 * @date 2020-11-18 17:10:45
 */
public interface CnShopService extends IService<CnShop> {
	/**
	 * 根据角色类型 获取后台的门店列表 分页查询
	 *
	 * @param page
	 * @param cnShopVo
	 * @return
	 */
	R findPage(Page page, CnShopVo cnShopVo);

    ShopDetail getShopDetail(Long id,BaseLonLat baseLonLat);
//	R findPage(Page page, HashMap map);

	AboutShopVo aboutShop(AboutShopReq aboutShopReq);

	/**
	 * C端（用户） 首页  爆款优惠
	 *
	 * @param longitude 经度
	 * @param latitude  纬度
	 * @param userId    登录人ID
	 * @return
	 */
	List<CnCouponDetailResp> getHotCouponList(String longitude, String latitude, Long userId);

	List<SearchResp> search(SearchReq searchReq);

	IPage<AboutShopVo> aboutShopList(Page page, AboutShopReq req);


	/**
	 * 根据品牌和门店
	 * 有定位就由远及近
	 * 没有定位就优惠券的多的在前
	 *
	 * @param page
	 * @param req
	 * @return
	 */
	IPage<AboutShopVo> aboutMaxCouponShopList(Page page, AboutShopReq req);

	PpgAndShopsResp ppgAndShops(Page page, PpgAndShopsReq req);

	List<CnShopDisVo> shopAndDistant(CnShopDisVo cnShopDisVo);

	List<CnShopDisVo> shopAndDistant4NotTyCoupon(String latitude, String longitude, Long couponId);

	IPage<AboutShopVo> pageByCoupon(Page page, AboutShopByCouponReq req);

	/**
	 * 获取不是多门店的优惠券
	 *
	 * @param longitude
	 * @param latitude
	 * @param userId
	 * @return
	 */
	List<CnCouponDetailResp> getCommonCouponList(String longitude, String latitude, Long userId, List<Long> ids);

	/**
	 * 获取多门店的优惠券
	 *
	 * @param longitude
	 * @param latitude
	 * @param userId
	 * @return
	 */
	List<CnCouponDetailResp> getMultiStoreCouponList(String longitude, String latitude, Long userId, List<Long> ids);

	/**
	 * 获取单个门店的优惠券
	 *
	 * @param longitude
	 * @param latitude
	 * @param userId
	 * @return
	 */
	List<CnCouponDetailResp> getSingleStoreCouponList(String longitude, String latitude, Long userId, List<Long> ids);

	/**
	 * 获取创建活动的门店
	 *
	 * @param labelId 标签ID
	 * @param name    门店名称
	 * @return
	 */
	List<CnShop> getActivityShop(Long labelId, String name);

	List<AboutShopVo> shopByIds(AboutShopReq req);

	List<CnShop> listByVoMap(Map<String, Object> map);

	CnShopVo getDetailById(Long id);

	/**
	 * 新增店铺表
	 *
	 * @param cnShopVo
	 * @return
	 */
	R saveAndUser(CnShopVo cnShopVo) throws Exception;

	/**
	 * 修改门店
	 *
	 * @param cnShopVo
	 * @return
	 */
	R updateAndUser(CnShopVo cnShopVo) throws Exception;

	/**
	 * 门店上下架
	 *
	 * @param cnShopVo 门店表
	 * @return
	 */
	R updateByDisplay(CnShopVo cnShopVo) throws Exception;

	/**
	 * 创建群组取门店列表（根据品牌标签, 品牌/门店名, 地址查询,协议类型)
	 * @param cnGroupShopVoReq
	 * @return
	 */
	List<CnGroupShopVoReq> getByGroup(CnGroupShopVoReq cnGroupShopVoReq);

    List<CnShopDisVo> distanceList(ShopDisListVo shopDisListVo);

	/**
	 * 获取卡能使用门店列表 （根据品牌标签, 品牌/门店名, 地址查询赛选）
	 * @param cardShopDto
	 * @return
	 */
	List<CardShopDto> getByInfoShop(CardShopDto cardShopDto);

	/**
	 * 根据门店ID获取全部门店信息
	 * @param shopId
	 * @return
	 */
    CnShopVo getByShopId(Long shopId);

	/**
	 * 创建优惠方案获取门店列表（根据品牌id, 门店名, 地址查询)
	 * @param page
	 * @param cnDiscountShopVoReq
	 * @return
	 */
	IPage<CnDiscountShopVoReq> getByDiscountPlan(Page page, CnDiscountShopVoReq cnDiscountShopVoReq);

	/**
	 * S-01首页（门店）分页查询
	 * @param page       分页
	 * @param homePageSearch   条件
	 * @return
	 */
    IPage<CnShopVo> getCmsShopPage(Page page, HomePageSearch homePageSearch);
}
